home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / autose1g / frmannou.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-06-11  |  10.5 KB  |  337 lines

  1. VERSION 5.00
  2. Begin VB.Form frmAnnounce 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "frmAnnounce"
  6.    ClientHeight    =   6795
  7.    ClientLeft      =   180
  8.    ClientTop       =   945
  9.    ClientWidth     =   9480
  10.    BeginProperty Font 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   12
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H00000000&
  20.    LinkTopic       =   "Form1"
  21.    PaletteMode     =   1  'UseZOrder
  22.    ScaleHeight     =   6795
  23.    ScaleWidth      =   9480
  24.    ShowInTaskbar   =   0   'False
  25.    Begin VB.CommandButton cmdOK 
  26.       Caption         =   "&Continue"
  27.       Default         =   -1  'True
  28.       Enabled         =   0   'False
  29.       BeginProperty Font 
  30.          Name            =   "MS Sans Serif"
  31.          Size            =   8.25
  32.          Charset         =   0
  33.          Weight          =   400
  34.          Underline       =   0   'False
  35.          Italic          =   0   'False
  36.          Strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   330
  39.       Left            =   4140
  40.       TabIndex        =   0
  41.       Top             =   5175
  42.       Visible         =   0   'False
  43.       Width           =   1200
  44.    End
  45.    Begin VB.PictureBox picAnnounce 
  46.       Appearance      =   0  'Flat
  47.       BackColor       =   &H00000000&
  48.       BorderStyle     =   0  'None
  49.       BeginProperty Font 
  50.          Name            =   "MS Sans Serif"
  51.          Size            =   9.75
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       ForeColor       =   &H0000FF00&
  59.       Height          =   3960
  60.       Left            =   1980
  61.       ScaleHeight     =   3960
  62.       ScaleWidth      =   5475
  63.       TabIndex        =   1
  64.       Top             =   945
  65.       Width           =   5475
  66.       Begin VB.Image Image4 
  67.          Height          =   180
  68.          Left            =   225
  69.          Picture         =   "frmAnnounce.frx":0000
  70.          Stretch         =   -1  'True
  71.          Top             =   3780
  72.          Width           =   5025
  73.       End
  74.       Begin VB.Image Image2 
  75.          Height          =   180
  76.          Left            =   225
  77.          Picture         =   "frmAnnounce.frx":42D2
  78.          Stretch         =   -1  'True
  79.          Top             =   0
  80.          Width           =   5010
  81.       End
  82.       Begin VB.Image Image1 
  83.          Height          =   4155
  84.          Left            =   5265
  85.          Picture         =   "frmAnnounce.frx":85A4
  86.          Stretch         =   -1  'True
  87.          Top             =   -180
  88.          Width           =   225
  89.       End
  90.       Begin VB.Image Image5 
  91.          Height          =   4170
  92.          Left            =   0
  93.          Picture         =   "frmAnnounce.frx":BEC6
  94.          Stretch         =   -1  'True
  95.          Top             =   -225
  96.          Width           =   225
  97.       End
  98.    End
  99.    Begin VB.Image imgSabotageFailed 
  100.       Height          =   600
  101.       Left            =   8280
  102.       Picture         =   "frmAnnounce.frx":F7E8
  103.       Stretch         =   -1  'True
  104.       Top             =   675
  105.       Visible         =   0   'False
  106.       Width           =   915
  107.    End
  108.    Begin VB.Image imgFailedInvasion 
  109.       Height          =   600
  110.       Left            =   6750
  111.       Picture         =   "frmAnnounce.frx":27DAA
  112.       Stretch         =   -1  'True
  113.       Top             =   5940
  114.       Visible         =   0   'False
  115.       Width           =   915
  116.    End
  117.    Begin VB.Image imgCaptured 
  118.       Height          =   600
  119.       Left            =   8280
  120.       Picture         =   "frmAnnounce.frx":4036C
  121.       Stretch         =   -1  'True
  122.       Top             =   1485
  123.       Visible         =   0   'False
  124.       Width           =   915
  125.    End
  126.    Begin VB.Image imgBioFailed 
  127.       Height          =   510
  128.       Left            =   8460
  129.       Picture         =   "frmAnnounce.frx":5892E
  130.       Stretch         =   -1  'True
  131.       Top             =   6060
  132.       Visible         =   0   'False
  133.       Width           =   795
  134.    End
  135.    Begin VB.Image imgSabotage 
  136.       Height          =   495
  137.       Left            =   8490
  138.       Picture         =   "frmAnnounce.frx":6F00C
  139.       Stretch         =   -1  'True
  140.       Top             =   5400
  141.       Visible         =   0   'False
  142.       Width           =   795
  143.    End
  144.    Begin VB.Image imgExpanding 
  145.       Height          =   585
  146.       Left            =   8550
  147.       Picture         =   "frmAnnounce.frx":8586E
  148.       Stretch         =   -1  'True
  149.       Top             =   4515
  150.       Visible         =   0   'False
  151.       Width           =   765
  152.    End
  153.    Begin VB.Image imgVictorious 
  154.       Height          =   750
  155.       Left            =   8280
  156.       Picture         =   "frmAnnounce.frx":9B730
  157.       Stretch         =   -1  'True
  158.       Top             =   3555
  159.       Visible         =   0   'False
  160.       Width           =   1095
  161.    End
  162.    Begin VB.Image imgOverrun 
  163.       Height          =   705
  164.       Left            =   8370
  165.       Picture         =   "frmAnnounce.frx":B51DA
  166.       Stretch         =   -1  'True
  167.       Top             =   2835
  168.       Visible         =   0   'False
  169.       Width           =   960
  170.    End
  171.    Begin VB.Image imgExplosion 
  172.       Height          =   525
  173.       Left            =   8370
  174.       Picture         =   "frmAnnounce.frx":CF29C
  175.       Stretch         =   -1  'True
  176.       Top             =   2175
  177.       Visible         =   0   'False
  178.       Width           =   720
  179.    End
  180. Attribute VB_Name = "frmAnnounce"
  181. Attribute VB_GlobalNameSpace = False
  182. Attribute VB_Creatable = False
  183. Attribute VB_PredeclaredId = True
  184. Attribute VB_Exposed = False
  185. Option Explicit
  186. Private Sub cmdOK_Click()
  187. 'close this form and return to the game
  188. PlaySoundEffect "Quiet"
  189. Unload Me
  190. End Sub
  191. Private Sub Form_Activate()
  192. Randomize
  193. 'draw lots of stars on the screen
  194.     Dim a, X, Y
  195.     For a = 1 To 500
  196.         X = Int(Rnd * frmAnnounce.ScaleWidth)
  197.         Y = Int(Rnd * frmAnnounce.ScaleHeight)
  198.         frmAnnounce.PSet (X, Y), vbWhite
  199.     Next a
  200.     'draw dark grey stars
  201.     Dim grey
  202.     grey = &H808080
  203.     For a = 1 To 400
  204.         X = Int(Rnd * Me.ScaleWidth)
  205.         Y = Int(Rnd * Me.ScaleHeight)
  206.         frmAnnounce.PSet (X, Y), grey
  207.     Next a
  208.     'draw some blue stars
  209.     Dim blue
  210.     blue = &H800000
  211.     For a = 1 To 400
  212.        X = Int(Rnd * frmAnnounce.ScaleWidth)
  213.        Y = Int(Rnd * frmAnnounce.ScaleHeight)
  214.        frmAnnounce.PSet (X, Y), blue
  215.     Next a
  216. Select Case MessageType
  217.     'Announceline variables set in frm_Load of frmGamescreen
  218.     'set picture, sound and text for each message
  219. Case "BioFailed"
  220.      picAnnounce.Picture = imgBioFailed.Picture
  221.      PlaySoundEffect "BioFail"
  222.      BeepingText Announceline1, Announceline2, Announceline3
  223. Case "Captured"
  224.      picAnnounce.Picture = imgCaptured.Picture
  225.      PlaySoundEffect "Overrun"
  226.      BeepingText Announceline1, Announceline2, Announceline3
  227.      
  228. Case "Expanding"
  229.      picAnnounce.Picture = imgExpanding.Picture
  230.      PlaySoundEffect "Abort"
  231.      BeepingText Announceline1, Announceline2, Announceline3
  232. Case "Explosion"
  233.     'set picture, sound and text
  234.     picAnnounce.Picture = imgExplosion.Picture
  235.     PlaySoundEffect "Explosion"
  236.     BeepingText Announceline1, Announceline2, Announceline3
  237.         
  238. Case "Failed Invasion"
  239.     'set picture, sound and text
  240.     picAnnounce.Picture = imgBioFailed.Picture
  241.     PlaySoundEffect "Overrun"
  242.     BeepingText Announceline1, Announceline2, Announceline3
  243. Case "Overrun"
  244.     picAnnounce.Picture = imgOverrun.Picture
  245.     PlaySoundEffect "Overrun"
  246.     BeepingText Announceline1, Announceline2, Announceline3
  247. Case "Sabotage"
  248.     picAnnounce.Picture = imgSabotage.Picture
  249.     PlaySoundEffect "Sabotage"
  250.     BeepingText Announceline1, Announceline2, Announceline3
  251. Case "Sabotage Failed"
  252.     picAnnounce.Picture = imgBioFailed.Picture
  253.     PlaySoundEffect "Sabotage"
  254.     BeepingText Announceline1, Announceline2, Announceline3
  255. Case "Victorious"
  256.     picAnnounce.Picture = imgVictorious.Picture
  257.     PlaySoundEffect "Overrun"
  258.     BeepingText Announceline1, Announceline2, Announceline3
  259. End Select
  260. End Sub
  261. Public Sub BeepingText(Announceline1 As String, Announceline2 As String, Announceline3 As String)
  262. '*********************
  263. 'Taking the Announceline strings from frmGamescreen's form_load procedure and prints
  264. 'them out one character at a time.
  265. 'I removed the beep, as it interferes with the
  266. 'sound effects playing
  267. '*********************
  268. Dim Length As Integer
  269. Dim Counter As Integer
  270. Dim X As Long
  271. 'line 1
  272. picAnnounce.CurrentX = 650
  273. picAnnounce.CurrentY = 140
  274. Length = Len(Announceline1)
  275. For Counter = 1 To Length
  276.     picAnnounce.Print Mid$(Announceline1, Counter, 1);
  277.     'If SoundOn Then
  278.     '    Beep
  279.     'End If
  280.     For X = 1 To 100000: Next X
  281. Next Counter
  282. 'carriage return
  283. picAnnounce.Print
  284. picAnnounce.CurrentX = 650
  285. Length = Len(Announceline2)
  286. If Length = 0 Then
  287.     'clear variables, enable ok button, exit sub
  288.     Announceline1 = ""
  289.     Announceline2 = ""
  290.     Announceline3 = ""
  291.     frmAnnounce.cmdOK.Visible = True
  292.     frmAnnounce.cmdOK.Enabled = True
  293.     Exit Sub
  294.     For Counter = 1 To Length
  295.         picAnnounce.Print Mid$(Announceline2, Counter, 1);
  296.         'If SoundOn Then
  297.         '    Beep
  298.         'End If
  299.         For X = 1 To 100000: Next X
  300.     Next Counter
  301. End If
  302. 'carriage return
  303. picAnnounce.Print
  304. picAnnounce.CurrentX = 650
  305. 'line 3
  306. Length = Len(Announceline3)
  307. If Length = 0 Then
  308.     'clear variables, enable ok button, exit sub
  309.     Announceline1 = ""
  310.     Announceline2 = ""
  311.     Announceline3 = ""
  312.     frmAnnounce.cmdOK.Visible = True
  313.     frmAnnounce.cmdOK.Enabled = True
  314.     Exit Sub
  315.     For Counter = 1 To Length
  316.         picAnnounce.Print Mid$(Announceline3, Counter, 1);
  317.         'If SoundOn Then
  318.         '    Beep
  319.         'End If
  320.         For X = 1 To 100000: Next X
  321.     Next Counter
  322. End If
  323. 'clear variables
  324. Announceline1 = ""
  325. Announceline2 = ""
  326. Announceline3 = ""
  327. frmAnnounce.cmdOK.Visible = True
  328. frmAnnounce.cmdOK.Enabled = True
  329. End Sub
  330. Private Sub Form_Load()
  331. 'reposition form if running in window mode
  332. If DefaultGameSize = 0 Then
  333.     Me.Top = 0
  334.     Me.Left = 0
  335. End If
  336. End Sub
  337.